<?php
 /**
 * Folder Structure
 * 
 * Basic information on understanding the file structure and how it all comes together
 * 
 * @editing     This page is specific to CI Docs documentation, therefor should not be edited
 * @url     /general/folder_structure
 */
?>

<h1><?php echo $title; ?></h1>

<p>One of the first things to do when using CI Docs is to understand how the folder structure and urls are tied together. Once you've got the hang of these, creating docs is a breeze. First we will go over folder structure, and in the next topic we will learn more about <?php echo $this->toc->link('general/understanding_urls', 'understanding urls'); ?>.</p>

<p>From the initial download, you will have a few files in your root. Here is a quick rundown of the root directory:</p>

<table class="table">
	<thead>
		<tr>
			<th>File / Folder</th>
			<th>Description</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><strong>/_htaccess</strong></td>
			<td>The sample .htaccess file for removing index.php from your urls.</td>
		</tr>
		<tr>
			<td><strong>/app/</strong></td>
			<td>The application root folder where you will be editing your files.</td>
		</tr>
		<tr>
			<td><strong>/index.php</strong></td>
			<td>The main index file that loads CI. No need to edit this unless you want to change app or system folder locations.</td>
		</tr>
		<tr>
			<td><strong>/license.txt</strong></td>
			<td>The CI Docs and CodeIgniter license info.</td>
		</tr>
		<tr>
			<td><strong>/system/</strong></td>
			<td>CodeIgniter's system folder. Required to run CI and CI Docs. You should NEVER edit this folder.</td>
		</tr>
	</tbody>
</table>

<p>You will be adding and editing files only inside of the <dfn>/app/</dfn> folder. Here is a list of files and folders that are specific to CI Docs:</p>

<table class="table">
	<thead>
		<tr>
			<th>File / Folder</th>
			<th>Description</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><strong>/app/config/ci_docs.php</strong></td>
			<td>The main config file for CI Docs. You will also have a User Guide specific config file in your <dfn>user_guides</dfn> directory.</td>
		</tr>
		<tr>
			<td><strong>/app/controllers/ci_docs_router.php</strong></td>
			<td>The main router for all urls. This is the only controller for CI Docs and does not need to be editied.</td>
		</tr>
		<tr>
			<td><strong>/app/language/english/ci_docs_lang.php</strong></td>
			<td>The global lang file for CI Docs. Anything in here will be available in any user guide.</td>
		</tr>
		<tr>
			<td><strong>/app/libraries/Docs.php</strong></td>
			<td>The Docs library which provides functionality around the site and holds the config.</td>
		</tr>
		<tr>
			<td><strong>/app/libraries/Themes.php</strong></td>
			<td>The Themes library which provides templating including master files, pages, and content blocks.</td>
		</tr>
		<tr>
			<td><strong>/app/libraries/Toc.php</strong></td>
			<td>The TOC library is responsible for generating and managing the Table of Contents and related functions.</td>
		</tr>
		<tr>
			<td><strong>/app/plugins/syntaxhighlighter/</strong></td>
			<td>The SyntaxHighlighter plugin used to highlight code blocks. No need to edit this directory.</td>
		</tr>
		<tr>
			<td><strong>/app/themes/</strong></td>
			<td>The themes folder that will hold the default theme and others if you decide to create some.</td>
		</tr>
		<tr>
			<td><strong>/app/user_guides/</strong></td>
			<td>The folder to hold all of your user guides and their related files.</td>
		</tr>
	</tbody>
</table>

<p>You will be adding and editing all of your user guides files inside of the <dfn>/app/user_guides/</dfn> directory. Here is a deeper insight of the user guides folder:</p>

<table class="table">
	<thead>
		<tr>
			<th colspan="2">All files and folders in this table have a root url of /app/user_guides/</th>
		</tr>
	</thead>
	<thead>
		<tr>
			<th>File / Folder</th>
			<th>Description</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><strong>/_licenses/</strong></td>
			<td>The folder that will hold all of your license files</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/</strong></td>
			<td>The main folder to hold your user guide. This folder will be the name of your user guide with underscores and in lowercase. <em>E.g. CI Docs = ci_docs</em></td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/config/<var>USER_GUIDE</var>_config.php</strong></td>
			<td>The config file specific to your user guide.</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/config/<var>USER_GUIDE</var>_toc.php</strong></td>
			<td>The TOC file that will generate your Table of Contents.</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/language/<var>LANGUAGE</var>/<var>USER_GUIDE</var>_lang.php</strong></td>
			<td>The language file specific to your user guide.</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/views/</strong></td>
			<td>Holds all of your views folders</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/views/content-blocks/</strong></td>
			<td>Holds content blocks that you can use in any page by calling <strong>$this->themes->block('block_name');</strong></td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/views/masters/</strong></td>
			<td>Holds the master template files</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/views/masters/main.master.php</strong></td>
			<td>The default master file that will get loaded.</td>
		</tr>
		<tr>
			<td><strong>/<var>USER_GUIDE</var>/views/pages/</strong></td>
			<td>Where you will be putting all of your documentation</td>
		</tr>
	</tbody>
</table>

<p class="note"><strong>Note:</strong> Anything with <var>USER_GUIDE</var> will actually be the name of your guide in lowercase and with underscores. <em>E.g. CI Docs = ci_docs</em></p>

<p>Now that you know the basic structure of CI Docs, we encourage you to take a peek inside of the CI Docs documentation directory and see how a finished user guide will look. The full documentation of CI Docs is included with the download and can be found in <dfn>/app/user_guides/ci_docs/</dfn>. This page will be located at <dfn>/app/user_guides/ci_docs/views/general/folder_structure.php</dfn>.</p>